package com.wlw.layoutmanager.adapters;


import android.net.Uri;
import android.view.SurfaceView;
import android.widget.VideoView;

import com.wlw.layoutmanager.R;
import com.wlw.layoutmanager.beans.VideoBean;

import java.util.List;

public class ViewPagerLayoutManagerAdapter extends BaseAdapter<VideoBean> {
    public ViewPagerLayoutManagerAdapter(int layoutResId, List<VideoBean> data) {
        super(R.layout.item_view_pager, data);
    }

    @Override
    public void onBindView(BaseViewHolder holder, VideoBean videoBean, int position) {
        holder.setImageView(R.id.img_thumb, videoBean.getImageResId());
        VideoView videoView = (VideoView) holder.getView(R.id.video_view);
        videoView.setVideoURI(Uri.parse("android.resource://" + holder.itemView.getContext().getPackageName() + "/" + videoBean.getVideoResId()));

    }
}
